//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2007 CORE Solutions Limited
// All rights reserved.
// PROPRIETARY AND CONFIDENTIAL INFORMATION.
// Use is subject to license terms.
//
// FUNCTION ID      :   FACT_AUDIT
// AUTHOR           :   Ray Guo 
// DATE CREATE      :   2007/09/10
// DESCRIPTION      :   a PK file for the function, FACT_AUDIT
//                  :   
//                  :   
//                  :   
//
// MODIFICATION HISTORY:
// DATE         AUTHOR          VERSION NO.         COMMENT
// -----------  --------------  ------------------  -------------------
// 2007/09/10   Ray Guo         1.0                 source is generated.
//
//
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

package com.erp.app.compliance.factAudit.pk;

import com.erp.framework.model.pk.SimpleSearchMaintStylePk;
import com.erp.framework.types.CustomBigInteger;

/**
* <p>A <strong>PK</strong>(Primay Key) stores the primary key which
* uniquely identifies each bean that is derived from database tables.
* A primary key can be a simple key, made up of a single attribute, or
* it can be a composite key, made up of a group of attributes from the bean.
* <br>
* As a suggested best practice, the PK class must implements the optional
* <code>java.lang.Object</code> methods, such as <code>equals</code> and
* <code>hashCode</code>
*
* @author          Ray Guo 
* @version 1.0     2007/09/10
* @since           FrameWork 1.0
*
*/
public class FactAuditProdCatPk extends SimpleSearchMaintStylePk {

	//PK Attributes
	public String companyCode;
	public String auditNo;
	public CustomBigInteger catLineNo;
	
	/**
	* Allocates and creates a new <code>Pk</code> that contains data from
	* the incoming parameters.
	*
	* @param      companyCode    the incoming company code
	* @param      auditNo        the incoming audit no
	* @param      catLineNo      the incoming line no
	* @author     Ray Guo 
	* @since      Framework 1.0
	*/
	public FactAuditProdCatPk(String companyCode, String auditNo, CustomBigInteger catLineNo) {
		this.companyCode = companyCode;
		this.auditNo = auditNo;
		this.catLineNo = catLineNo;
	}

	/**
	* Return a unique number representing the hash code for the
	* primary key instance.  Ensure that the hash code is indeed
	* unique when it is computed from the primary key attributes.
	* @return     the computed integer representing the primary key
	*
	* @author     Ray Guo 
	* @since      Framework 1.0
	*/
	public int hashCode() {
		return (this.companyCode + "::" + this.auditNo + "::" + this.catLineNo).hashCode();
	}

	/**
	* Properly evaluate the equality of two primary keys
	* by comparing values for each part of the composite key.
	* @param      obj     the primary key to compare this <code>String</code>
	*                     against.
	* @return     <code>true</code>     if the <code>primary keys</code> are equal;
	*             <code>false</code>    otherwise.
	*
	* @author     Ray Guo 
	* @since      Framework 1.0
	*/
	public boolean equals(Object obj) {
		if (obj instanceof FactAuditProdCatPk) {
			FactAuditProdCatPk pk2 = (FactAuditProdCatPk) obj;
			return (this.companyCode != null && this.companyCode.equals(pk2.companyCode)
				&& this.auditNo != null && this.auditNo.equals(pk2.auditNo)
				&& this.catLineNo != null && this.catLineNo.equals(pk2.catLineNo));			
		}
		return false;
	}

	/**
	* Converts to a string representing the data in this object.
	* A new <code>String</code> object is allocated and initialized to 
	* contain the character sequence currently represented by this 
	* object. This <code>String</code> is then returned. Subsequent 
	* changes to this object do not affect the contents of the 
	* <code>String</code>. 
	*
	* @return     a string representation of the object.
	* @see        java.lang.Object#toString()
	* @author     Ray Guo 
	* @since      Framework 1.0
	*/
	public String toString() {
		return "{companyCode = " + this.companyCode
				+ ", auditNo = " + this.auditNo
				+ ", catLineNo = " + this.catLineNo + "}";		
	}

	//Getters only
	public String getCompanyCode() {
		return companyCode;
	}

	public String getAuditNo() {
		return auditNo;
	}

	public CustomBigInteger getCatLineNo() {
		return catLineNo;
	}

}
